{% extends 'mobile_base_frame.html'%}
{% load i18n %}

{% block import_extend_js %}
    <script src="{{MEDIA_URL}}/wap/jqm-datebox.core.min.js"></script>
    <script src="{{MEDIA_URL}}/wap/jqm-datebox.mode.datebox.min.js"></script>
    <script src="{{MEDIA_URL}}/wap/mobile_edit.js"></script>
{% endblock %}

{% block hidden %}
    <input type="hidden" value="{{app_label}}" id="app_label"></input>
    <input type="hidden" value="{{model_app}}" id="model_app"></input>
    <input type="hidden" value="{{model_name}}" id="model_name"></input>
    <input type="hidden" value="{{detail}}" id="detail"></input>
    <input type="hidden" value="{{key}}" id="key"></input>
{% endblock %}

{% block header %}
    <a data-role="button" data-iconpos="notext" data-icon="back" data-rel="back"></a>
    <h1>
      {% if key %}
         {% trans '修改' %}
      {% else %}
         {% trans '新增' %}
      {% endif %}
      {{title }}
    </h1>
    <a href="#info" data-rel="popup" data-role="button" data-icon="user" data-iconpos="notext" class="ui-btn-right">Grid</a>
{% endblock %}

{% block content%}
    {% block extend_content%}
    {% endblock %}
    {% block data_form %}
      <form id="data_form" >
        {{form.as_table}}
        {% block extend_fileds %}
        {% endblock %}
      </form>
    {% endblock %}
    <div id="error_info" class="wap-error-info"></div>
    <div style="text-align:center">
        <a href="" data-role="button" data-inline="true" id="OK" >{% trans '提交' %}</a>
        <a href="" data-role="button" data-inline="true" id="BACK" data-rel="back" >{% trans '取消' %}</a>
    </div>
{% endblock %}
    {% block addjs%}
    {% endblock %}


{% block popup %}
    <div data-role="popup" id="help_txt">
        {% if op.help_text %}
        <p>{{op.help_text}}<p>
        {% else %}
        <p>{{title}}<p>
        {% endif %}
    </div>
    <div data-role="popup" id="info">
         <ul data-role="listview">
           <li data-icon="false"><a href="#" data-icon="false">{% trans "姓名" %}:{{employee.EName}}</a></li>
           <li data-icon="false"><a href="#" >{% trans "工号" %}:{{employee.PIN}}</a></li>
           <li data-icon="false"><a href="#" id="logout">{% trans '退出' %}</a></li>
         </ul>
    </div>
    <div data-role="popup" id="event_info">
         <p>© 2014 中控科技</p>
    </div>
{% endblock %}

{% block footer %}
	<div data-role="navbar" data-theme="b">
		<ul>
			<li><a href="#help_txt" data-rel="popup" data-icon="info" data-theme="b"></a></li>
			<!--<li><a href="#event_info" data-rel="popup" data-icon="star" data-theme="b"></a></li>-->
			<li><a id="home" href="/{{app_label}}/{{app_menu}}/UI/"  data-icon="home" data-theme="b"></a></li>
		</ul>
	</div><!-- /navbar -->
{% endblock %}


